import config from '@/config'
import storage from '@/utils/storage'
import constant from '@/utils/constant'
import {
	login,
	logout,
	getInfo
} from '@/api/login'
import {
	getToken,
	setToken,
	removeToken
} from '@/utils/auth'

const baseUrl = config.baseUrl

const location = {
	state: {
		token: getToken(),
		location: null,
		locationList: {
			enterpriseId: '',
			typeName: "",
			longitude: '',
			latitude: '',
			status: "",
			locationName: "",
			openTime: "",
			closeTime: "",
			ticketPrice: '',
			phone: "",
			address: "",
			vrView: "",
			locationTypeId: '',
			introduction: "",
			voiceKey: "",
			videoKey: "",
			pics: [],
			featurePics: [{
				feature: {
					featureId: Math.random(),
					title: "",
					remark: "",
				},
				pics: [{
					remark: "",
					objKey: "",
					url: []
				}]
			}]
		},
	},

	mutations: {
		RESTLIST(state) {
			state.locationList = {
				enterpriseId: '',
				typeName: "",
				longitude: '',
				latitude: '',
				status: "",
				locationName: "",
				openTime: "",
				closeTime: "",
				ticketPrice: '',
				phone: "",
				address: "",
				vrView: "",
				locationTypeId: '',
				introduction: "",
				voiceKey: "",
				videoKey: "",
				pics: [],
				featurePics: [{
					feature: {
						featureId: Math.random(),
						title: "",
						remark: "",
					},
					pics: [{
						remark: "",
						objKey: "",
						url: []
					}]
				}]
			}
		}
	},
	getters: {
		getLocationList(state) {
			return state.locationList
		},
	},
	actions: {

	}
}

export default location